import request from '@/utils/request';

export async function getById(params) {
  return request(`/api/AgentServer/GetById`, {
    method: 'GET',
    params
  });
}
export async function getPublishFlowById(params) {
  return request(`/api/PublishFlow/GetById`, {
    method: 'GET',
    params
  });
}

export async function getHealthy(params) {
  return request(`/api/AgentServer/GetHealthy`, {
    method: 'GET',
    params: { ...params },
  });
}
export async function getAgentRootPath(params) {
  return request(`/api/AgentServer/GetAgentRootPath`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getDirectory(params) {
  return request(`/api/AgentServer/GetDirectory`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function getFlowZipFileList(params) {
  return request(`/api/PublishFlow/GetFlowZipFileList`, {
    method: 'GET',
    params: { ...params },
  });
}

export async function backup(params) {
  return request(`/api/AgentServer/Backup`, {
    method: 'POST',
    data: { ...params },
  });
}


export async function savePublishFlowNode(params) {
  return request(`/api/PublishFlow/SavePublishFlowNode`, {
      method: 'POST',
      data: { ...params },
  });
}

export async function surePublish(params) {
  return request(`/api/PublishFlow/SurePublish`, {
      method: 'POST',
      data: { ...params },
  });
}

export async function commandRunScript(params) {
  return request(`/api/PublishFlow/CommandRunScript`, {
      method: 'POST',
      data: { ...params },
  });
}


export async function getLogList(params) {
  return request(`/api/PublishFlow/GetLogList`, {
    method: 'GET',
    params: { ...params },
  });
}
